<?php
require_once '../lib/standard.php';
unset($_SESSION['tl_login']);
Page::data();
set_globals();

$globals->perastike_check('login');
$login = $globals->asfales($_REQUEST['login']);

$globals->perastike_check('password');
$password = $globals->asfales(sha1($_REQUEST['password']));

$query = "SELECT `login` FROM `pektis` WHERE (`login` = BINARY '" . $login .
	"') AND (`password` = BINARY '" . $password . "')";
$result = @mysqli_query($globals->db, $query);
if (!$result) {
	$globals->klise_fige("SQL query: failed");
}
$count = 0;
while ($row = @mysqli_fetch_array($result, MYSQLI_NUM)) {
	$login = $row[0];
	$count++;
}
if ($count != 1) {
	$globals->klise_fige("Access denied");
}
$_SESSION['tl_login'] = $login;
?>
